<?php
/**
 * Created by PhpStorm.
 * User: hisheng
 * Date: 2017/6/8
 * Time: 14:58
 */
namespace App\Dao;

use App\Banner;
use App\Http\Controllers\Controller;

class BannerDao extends Controller
{
    public $banner;
    
    public function __construct(Banner $banner)
    {
        $this->banner = $banner;
    }
    
    public function all(){
        $banner = $this->banner->orderBy('created_at','desc')->where('is_delete',0)->get();
        $banners = [];
        if($banner){
            $b = $banner->toArray();
            $banners = $this->originImage($b);
        }
        return $banners;
    }
    
    
}
